package com.kolakcc.loljclient;

import javax.swing.UIManager;

import com.gvaneyck.rtmp.LoLRTMPSClient;
import com.kolakcc.loljclient.controller.AboutController;
import com.kolakcc.loljclient.controller.ChampionDetailedController;
import com.kolakcc.loljclient.controller.ChampionsController;
import com.kolakcc.loljclient.controller.CustomGameListController;
import com.kolakcc.loljclient.controller.CustomGameLobbyController;
import com.kolakcc.loljclient.controller.FriendsListController;
import com.kolakcc.loljclient.controller.LoginController;
import com.kolakcc.loljclient.controller.MainController;
import com.kolakcc.loljclient.controller.ProfileController;
import com.kolakcc.loljclient.controller.RecievePacketController;
import com.kolakcc.loljclient.model.Champion;
import com.kolakcc.loljclient.model.CustomGameListItem;
import com.kolakcc.loljclient.model.LoLNewsItem;
import com.kolakcc.loljclient.view.SettingsView;
import com.kolakcc.loljclient.view.WebView;

public class StartupClass {
	public static LoLRTMPSClient Client;
	protected static LoginController loginController;
	protected static MainController mainController;
	protected static CustomGameListController customGameListController;
	protected static FriendsListController friendsListController;
	protected static ChampionsController championsController;
	protected static AboutController aboutController;
	public static CustomGameLobbyController customGameLobbyController;

	public static void LoggedIn() {
		loginController.dispose();
		mainController = new MainController();
		Client.setReceiveHandler(new RecievePacketController());
	}

	public static void main(String[] args) {
		try {
			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
		} catch (Exception e) {
			System.err.println("No System Look and feel found, continuing with default...");
		}
		loginController = new LoginController();
	}

	public static void openAbout() {
		aboutController = new AboutController();
	}

	public static void openChampionDetails(Champion c) {
		new ChampionDetailedController(c);
	}

	public static void openChampions() {
		new ChampionsController();
	}

	public static void openCustomGameLobbyController(CustomGameListItem game) {
		customGameLobbyController = new CustomGameLobbyController(game);
	}

	public static void openCustomGames() {
		customGameListController = new CustomGameListController();
	}

	public static void openFriends(String username, String password) {
		friendsListController = new FriendsListController(username, password);
	}

	public static void openNewsItem(LoLNewsItem item) {
		new WebView(item);
	}

	public static void openProfile() {
		new ProfileController();
	}

	public static void openSettings() {
		new SettingsView();
	}
}
